<?php

class admin_core_Ads_Form_Edit extends Engine_Core_Form
{
	/**
	 * @var core_Ads
	 */
	protected $_adapter;

	/**
	 * @return core_Ads
	 */
	protected function getAdapter()
	{
		if (empty($this->_adapter)) {
			$this->_adapter = core_Ads::getInstance();
		}

		return $this->_adapter;
	}

    public function init()
    {
        parent::init();

        $this->addElement('hidden', 'id', array(
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('Int'),
            ),
            'order' => 100,
        ));

        $this->addElement('text', 'title', array(
            'filters'    => array('StringTrim'),
            'required'   => true,
            'label'      => 'Title:',
            'order' => 200,
        ));

        $this->addElement('textarea', 'announce', array(
            'filters'    => array('StringTrim'),
            'required'   => true,
            'label'      => 'Announce:',
            'order'      => 300,
            'rows'       => 5
        ));
/*
        $this->addElement('file', 'image', array(
            'filters'     => array(
                new Engine_Filter_FileUniqueName(array('targetDir' => '/upload')),
            ),
            'validators' => array(
                new Zend_Validate_File_Count(2),
				new Zend_Validate_File_Size(2048000),
				new Zend_Validate_File_ExcludeExtension('php'),
				new Zend_Validate_File_ExcludeMimeType("text/html")
            ),
            'label'       => 'Image:',
            'order' => 400,
        ));
*/
        $this->addElement('submit', 'send', array(
            'required' => false,
            'ignore'   => true,
            'label'    => 'Save',
            'order' => 1000000,
        ));
    }
}

